Component({
  mixins: [],
  data: {
    listData: [],
    total: 0,
    page: 1,
    pagesize: 5
  },
  props: {},
  didMount() {
    this.getUserVideoList(0)
  },
  didUpdate() { },
  didUnmount() { },
  methods: {
    getUserVideoList(pageNum) {
      var apiurl = 'App.ShopRedsSales.GetApplySales';
      var params = {
        "status": 3,
        "page": pageNum,
        "pagesize": this.data.pagesize,
      };
      var app = getApp();
      var self = this;
      app.xdapis(apiurl, params, function (e) {
        my.hideLoading();
        //my.alert({ content:'123'+JSON.stringify(e) });
        self.setData({
          listData: e.list,
          total: e.page_info.total
        });
      });
    },
    getPageData(current) {
      this.getUserVideoList(current.detail.value);
    },
    handleNo(evt) {
      const { id } = evt.target.dataset;
      var self = this;
      my.confirm({
        title: '确认',
        content: '确定删除该视频吗?',
        success: (result) => {
          if (result.confirm) {
            var apiurl = 'App.ShopRedsSales.ApprovalSales';
            var params = {
              "sales_apply_id": id,
              "status": 0
            };
            var app = getApp();
            app.xdapis(apiurl, params, function (e) {
              my.hideLoading();
              my.showToast({ content: '操作成功!' });
              self.getUserVideoList(0);
            });
          }
        }
      });
    }
  },
});
